package com.learn.chapter01;

import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

import java.util.List;

/**
 * @author: liyf
 * @create: 2025-02-06 14:25
 **/
public class First {

    @Test
    void testList() {

        // 创建mock对象
        List mockedList = Mockito.mock(List.class);

        // 使用mock对象
        mockedList.add("one");
        mockedList.clear();

        // 验证
        Mockito.verify(mockedList).add("one");
        Mockito.verify(mockedList).clear();
    }
}
